extends "../bisimai-3/bisimai-3.gd"


var baseId = ""
var upText1 = "铁血宰相额外提供20%装甲加成"
var upText2 = "帝国意志反弹的伤害提高200%"
func _extInit():
	._extInit()
	lv = 4             #等级的设置
	addSkill("我方赤色中轴阵营角色每{cd}秒可100%免疫并反弹一次伤害", "帝国意志", "bisimai4", 8)
var p4 = 1
func _castCdSkill(id):
	._castCdSkill(id)
	if id == "bisimai4":
		bisimai4()

func bisimai4():
	for i in getAllChas(2):
		if i.hasBuff("b_bisimai4") == null:
			castBuff(i, b_bisimai4.new())

class b_bisimai4:
	extends "../../../../azurlane_ctrl/AzurBuff.gd"
	var p = 1
	func _init():
		attInit()
		id = "b_bisimai4"
		buffName = "帝国意志"
		dispel = 2
	func _connect():
		if casCha.lv < 3:return
		masCha.connect("onHurt",self,"onHurt")
		if casCha.upgraded == 2:p = 3
	func onHurt(atkInfo):
		if not atkInfo.isMiss and not atkInfo.virtual and atkInfo.atkCha.camp != "塞壬":
			atkInfo.virtual = true
			casCha.azurHurtChara(atkInfo.atkCha, atkInfo.atkVal, sys.HurtType.WEAPON, sys.AtkType.EFF, "帝国意志", false, p)
			isDel = true